Enable test for running_on_xen from modules
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Fri, 4 Nov 2005 03:37:29 +0000 (21:37 -0600)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Fri, 4 Nov 2005 03:37:29 +0000 (21:37 -0600)
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>

linux-2.6-xen-sparse/arch/ia64/xen/Makefile
linux-2.6-xen-sparse/arch/ia64/xen/xen_ksyms.c [new file with mode: 0644]
linux-2.6-xen-sparse/arch/ia64/xen/xensetup.S
linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h

index 0ecefd3c892eafe81d667909bc4c0fa675511db7..8a83e573108b7eea48c9de7cc4653d8c234e6237 100644 (file)
@@ -2,4 +2,4 @@
 # Makefile for Xen components
 #
 
-obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o xenconsole.o
+obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o xenconsole.o xen_ksyms.o
diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/xen_ksyms.c b/linux-2.6-xen-sparse/arch/ia64/xen/xen_ksyms.c
new file mode 100644 (file)
index 0000000..83cff0b
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Architecture-specific kernel symbols
+ *
+ * Don't put any exports here unless it's defined in an assembler file.
+ * All other exports should be put directly after the definition.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+extern int is_running_on_xen(void);
+EXPORT_SYMBOL(is_running_on_xen);
index 6f078961d47ca589cd0f853d1810f268f1b83ec9..242c5c2f250ba73b15e03c581c4850071db01c3c 100644 (file)
@@ -25,3 +25,9 @@ GLOBAL_ENTRY(early_xen_setup)
 (p7)   mov cr.iva=r10
        br.ret.sptk.many rp;;
 END(xen_init)
+
+GLOBAL_ENTRY(is_running_on_xen)
+       movl r9=running_on_xen;;
+       ld4 r8=[r9];;
+       br.ret.sptk.many rp;;
+END(is_running_on_xen)
index e746cd93b4146aa4e40f4b51cfd4d7bc9a75ccfe..235197b8f4ce5c1917fe53bb82466f344e37592b 100644 (file)
 #endif
 
 #ifndef __ASSEMBLY__
+#ifdef MODULE
+extern int is_running_on_xen(void);
+#define running_on_xen (is_running_on_xen())
+#else
 extern int running_on_xen;
+#endif
 
 #define        XEN_HYPER_SSM_I                 asm("break 0x7");
 #define        XEN_HYPER_GET_IVR               asm("break 0x8");